<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="./css/mui.min.css">
    <link rel="stylesheet" href="./css/main.css">
    <title>历史开票</title>
</head>

<body>
    <div class="search_name">
        <input type="text" placeholder="请输入委方或购方关键字，例：九洲" id="custOrBuyerName">
    </div>
    <div class="search_name" id="time">
        请选择提交开票申请时间
    </div>
    <div class="warmPrompt">
        <p class="warmO">温馨提示</p>
        <p class="warmT">客户一次性可查询的时间段限制为6个月以内</p>
    </div>
    <div class="queryS">
        查询
    </div>
    <div class="big">
        <div class="time">
            <p class="time-title">请选择提交开票申请时间</p>
            <p class="selectT">当天</p>
            <p class="selectT">本月</p>
            <p class="selectT">上个月</p>
            <p class="selectT">三个月内</p>
            <p class="selectT">六个月内</p>
            <p class="timeCancel">取消</p>
        </div>
    </div>
    <!-- 选择日期 -->
    <input type="hidden" value="" id="date">
    <script src="./js/jquery-3.2.1.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/path.js"></script>
    <script src="./js/mui.min.js"></script>
    <script type="text/javascript">

        var text = decodeURI(getQueryString('text'))
        $('title').text(text);

        // 点击申请时间信息
        $('#time').click(() => {
            $('.big').show();
        })

        //点击取消
        $(".timeCancel").click(() => {
            $('.big').hide();
        })

        //选择申请时间
        $(".selectT").click(function() {
            var num = $(this).index();
            $('#time').text($(this).text());
            switch (num) {
                case 1:
                    $('#date').val('today')
                    break;
                case 2:
                    $('#date').val('thisMon')
                    break;
                case 3:
                    $('#date').val('lastMon')
                    break;
                case 4:
                    $('#date').val('thrMon')
                    break;
                case 5:
                    $('#date').val('sixMon')
                    break;
                default:
            }
            $('.big').hide();
        })

        // 点击查询
        $('.queryS').click(() => {
            var custOrBuyerName = $("#custOrBuyerName").val();
            var state = decodeURI(getQueryString('state'));
            var date = $("#date").val();
            var type =  decodeURI(getQueryString('type'));   //作废或者红冲
            if(custOrBuyerName!=''&date!=''){
                window.location.href = "./selectResult.html?custOrBuyerName=" + custOrBuyerName +'&state='+state+'&date='+date+'&type='+type;
            }else if(custOrBuyerName==''){
                mui.alert('请输入委方或购方关键字！');
            }else if(date==''){
                mui.alert('请选择开票申请时间！');
            }
        })
    </script>
</body>

</html>
